
        // 计算乘积函数（把他想象成一个非常复杂的函数）
        var mult = function () {
            console.log("这里有一个复杂的计算");
            var n = 1
            for (let i = 1; i < 10000000; i++) {
                n = n + i
            }
            return n
        }
        // console.log(mult(2,3,4));
        // console.log(mult(2,3,4,5));

        var multProxy = (function () {
            var cache = {}
            return function() {
                 var args = Array.prototype.join.call(arguments,",")
                 if(cache[args]){
                    return cache[args]
                 }
                return cache[args] = mult.apply(this,arguments)
            }
        })()
        console.time("首次加载....")
        console.log(multProxy(2,3,4));
        console.log(multProxy(2,3,4,5));
        console.timeEnd("首次加载....")
        console.log("----------------");
        console.time("二次加载....")
        console.log(multProxy(2,3,4));
        console.log(multProxy(2,3,4,5));
        console.timeEnd("二次加载....")